<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/client/backgroundManagement/commons/global.jsp" %>
 
 <script type="text/javascript">
   var c = <%= request.getAttribute("entity")%>;

   for(var i=0;i<c.length;i++){
		 $('#timeNode'+(i+1))[0].value=c[i].TIMENODE_NAME;
		 $('#cycle'+(i+1))[0].value=c[i].TIMENODE_CYCLE;
		 $('#cycle'+(i+1))[0].value=c[i].TIMENODE_CYCLE;
   }
   
   $('#projectTypeId')[0].value = c[0].PROJECT_TYPE_ID ; 
   $('#oldProjectTypeName')[0].value = c[0].PROJECT_TYPE_NAME ; 
   $('#projectTypeName')[0].value = c[0].PROJECT_TYPE_NAME ;
   $('#timeNodeSize')[0].value = c.length ;
   
   
    $(function() {
        
        $('#projectTypeEditForm').form({
            url : '${path }/projectTypeController/edit',
            onSubmit : function() {
                progressLoad();
                var isValid = $(this).form('validate');
                if (!isValid) {
                    progressClose();
                }
                return isValid;
            },
            success : function(result) {
                progressClose();
                result = $.parseJSON(result);
                if (result.success) {
                    parent.$.modalDialog.openner_dataGrid.datagrid('reload');//之所以能在这里调用到parent.$.modalDialog.openner_treeGrid这个对象，是因为organization.jsp页面预定义好了
                    parent.$.modalDialog.handler.dialog('close');
                }else{
                 	 console.log(result)
                	 alert("操作失败,请稍后重试")
                }
            }
        });
        
    });
</script>
 
<div class="easyui-layout" data-options="fit:true,border:false">
    <div data-options="region:'center',border:false" title="" style="overflow: hidden;padding: 3px;">
        <form id="projectTypeEditForm" method="post">
            <table class="grid">
 
 	            <tr>
                    <td>项目类型名称</td>
                    <td>
	                    <input name="oldProjectTypeName" type="hidden" id="oldProjectTypeName" text="原项目类型名称"/>
	                    <input name="projectTypeId" type="hidden"  id="projectTypeId" text="项目类型ID"/>
	                    <input name="timeNodeSize" type="hidden"  id="timeNodeSize" text="原先节点个数"/>
	                    <input name="projectTypeName" type="text" id="projectTypeName" placeholder="请输入名称" style="width: 250px"class="easyui-validatebox span2" data-options="required:true" />
                    </td>
                </tr>
                
                <tr>
                    <td>节点1名称</td>
                    <td>
	                    <input name="timeNodeName"  id="timeNode1" type="text" placeholder="请输入名称" style="width: 318px"  class="easyui-validatebox span2" />
                    </td>
                     <td>节点周期</td>
                    <td>
	                    <input name="circle"  id="cycle1" type="text" placeholder="请输入周期" width="40"  class="easyui-numberbox"   />
                    </td>
                </tr>
                 
                 <tr>
                    <td>节点2名称</td>
                    <td>
	                    <input name="timeNodeName"  id="timeNode2" type="text" placeholder="请输入名称" style="width: 318px"  class="easyui-validatebox span2" />
                    </td>
                     <td>节点周期</td>
                    <td>
	                    <input name="circle"  id="cycle2" type="text" placeholder="请输入周期" width="40"  class="easyui-numberbox"   />
                    </td>
                </tr>
                                <tr>
                    <td>节点3名称</td>
                    <td>
	                    <input name="timeNodeName"  id="timeNode3" type="text" placeholder="请输入名称" style="width: 318px"  class="easyui-validatebox span2" />
                    </td>
                     <td>节点周期</td>
                    <td>
	                    <input name="circle"  id="cycle3" type="text" placeholder="请输入周期" width="40"  class="easyui-numberbox"   />
                    </td>
                </tr>
                                <tr>
                    <td>节点4名称</td>
                    <td>
	                    <input name="timeNodeName"  id="timeNode4" type="text" placeholder="请输入名称" style="width: 318px"  class="easyui-validatebox span2" />
                    </td>
                     <td>节点周期</td>
                    <td>
	                    <input name="circle"  id="cycle4" type="text" placeholder="请输入周期" width="40"  class="easyui-numberbox"   />
                    </td>
                </tr>
                                <tr>
                    <td>节点5名称</td>
                    <td>
	                    <input name="timeNodeName"  id="timeNode5" type="text" placeholder="请输入名称" style="width: 318px"  class="easyui-validatebox span2" />
                    </td>
                     <td>节点周期</td>
                    <td>
	                    <input name="circle"  id="cycle5" type="text" placeholder="请输入周期" width="40"  class="easyui-numberbox"   />
                    </td>
                </tr>
                                <tr>
                    <td>节点6名称</td>
                    <td>
	                    <input name="timeNodeName"  id="timeNode6" type="text" placeholder="请输入名称" style="width: 318px"  class="easyui-validatebox span2" />
                    </td>
                     <td>节点周期</td>
                    <td>
	                    <input name="circle"  id="cycle6" type="text" placeholder="请输入周期" width="40"  class="easyui-numberbox"   />
                    </td>
                </tr>
                                <tr>
                    <td>节点7名称</td>
                    <td>
	                    <input name="timeNodeName"  id="timeNode7" type="text" placeholder="请输入名称" style="width: 318px"  class="easyui-validatebox span2" />
                    </td>
                     <td>节点周期</td>
                    <td>
	                    <input name="circle"  id="cycle7" type="text" placeholder="请输入周期" width="40"  class="easyui-numberbox"   />
                    </td>
                </tr>
                                <tr>
                    <td>节点8名称</td>
                    <td>
	                    <input name="timeNodeName"  id="timeNode8" type="text" placeholder="请输入名称" style="width: 318px"  class="easyui-validatebox span2" />
                    </td>
                     <td>节点周期</td>
                    <td>
	                    <input name="circle"  id="cycle8" type="text" placeholder="请输入周期" width="40"  class="easyui-numberbox"   />
                    </td>
                </tr>
                                <tr>
                    <td>节点9名称</td>
                    <td>
	                    <input name="timeNodeName"  id="timeNode9" type="text" placeholder="请输入名称" style="width: 318px"  class="easyui-validatebox span2" />
                    </td>
                     <td>节点周期</td>
                    <td>
	                    <input name="circle"  id="cycle9" type="text" placeholder="请输入周期" width="40"  class="easyui-numberbox"   />
                    </td>
                </tr>
                   <tr>
                    <td>节点10名称</td>
                    <td>
	                    <input name="timeNodeName"  id="timeNode10" type="text" placeholder="请输入名称" style="width: 318px" class="easyui-validatebox span2" />
                    </td>
                     <td>节点周期</td>
                    <td>
	                    <input name="circle"  id="cycle10" type="text" placeholder="请输入周期" width="40"  class="easyui-numberbox"   />
                    </td>
                </tr>
                
                                   <tr>
                    <td>节点11名称</td>
                    <td>
	                    <input name="timeNodeName"  id="timeNode11" type="text" placeholder="请输入名称" style="width: 318px" class="easyui-validatebox span2" />
                    </td>
                     <td>节点周期</td>
                    <td>
	                    <input name="circle"  id="cycle11" type="text" placeholder="请输入周期" width="40"  class="easyui-numberbox"   />
                    </td>
                </tr>
                
               <tr>
                    <td>节点12名称</td>
                    <td>
	                    <input name="timeNodeName"  id="timeNode12" type="text" placeholder="请输入名称" style="width: 318px" class="easyui-validatebox span2" />
                    </td>
                     <td>节点周期</td>
                    <td>
	                    <input name="circle"  id="cycle12" type="text" placeholder="请输入周期" width="40"  class="easyui-numberbox"   />
                    </td>
                </tr>                
            </table>
        </form>
    </div>
</div>